using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace Platform.ChooseTextPanel
{
    class Util
    {
        public static void Log(string msg)
        {
            byte[] data = Encoding.UTF8.GetBytes(msg + "\r\n");
            FileStream fs = new FileStream(System.Windows.Forms.Application.StartupPath + @"\error.log", FileMode.Append);
            fs.Write(data, 0, data.Length);
            fs.Close();
            fs.Dispose();
        }
        public static string GetFileTxt(string file, Encoding encode)
        {
            FileStream fs = new FileStream(file, FileMode.Open);
            byte[] data = new byte[fs.Length];
            fs.Read(data, 0, data.Length);
            fs.Close();
            fs.Dispose();
            return encode.GetString(data);
        }
    }
}
